package com.docking.heylo.dao.mapper;

import java.util.List;
import java.util.Map;

import com.docking.heylo.dao.entity.PersonalInformation;
import com.docking.heylo.dao.entity.PersonalInformationExample;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface PersonalInformationMapper {
    long countByExample(PersonalInformationExample example);

    int deleteByExample(PersonalInformationExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(PersonalInformation record);

    int insertSelective(PersonalInformation record);

    List<PersonalInformation> selectByExample(PersonalInformationExample example);

    PersonalInformation selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") PersonalInformation record, @Param("example") PersonalInformationExample example);

    int updateByExample(@Param("record") PersonalInformation record, @Param("example") PersonalInformationExample example);

    int updateByPrimaryKeySelective(PersonalInformation record);

    int updateByPrimaryKey(PersonalInformation record);

    PersonalInformation selectByUserId(@Param("userId") Integer id);

    void pushPost(@Param("userId") int userId);

    void removePost(@Param("userId") int userId);

    public Map<String, Object> simpleUserInfo(@Param("userId") int userId);

    public int like(@Param("userId") int userId);

    public int cancelLike(@Param("userId") int userId);


    @Select(" select a.id,a.name,a.sex,a.avatar,b.type " +
            " from tb_personal_information a " +
            " left join tb_user b on a.user_id = b.id " +
            " where a.name like '%${name}%'")
    List<Map<String, Object>> searchByName(@Param("name") String name);
}